﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using Model;

namespace DAL.Mappings
{
    public class ApartmentMap:ClassMap<Apartment>
    {
        public ApartmentMap()
        {
            Id(x => x.Id);
            Map(x => x.Code);
            Map(x => x.Building);
            References(x => x.State);
            References(x => x.Floor);
            References(x => x.RoomsNumber);
            References(x => x.Facade);
            Map(x => x.Model);
            Map(x => x.Price);
            Map(x => x.TotalPrice);
            Map(x => x.TotalPrice1);
            HasMany(x => x.Rooms).Cascade.AllDeleteOrphan();
            Map(x => x.Area);

            References(x => x.IndexTable).Cascade.All();
        }
    }
}
